package com.garyme.hycloud.service.impl;

import cn.dev33.satoken.stp.StpInterface;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * 自定义权限验证接口扩展
 */
@Component
public class StpInterfaceImpl implements StpInterface {

    // 返回一个账号所拥有的权限码集合
    @Override
    public List<String> getPermissionList(Object loginId,String loginType) {
        if(loginId.equals("101")){
            return Arrays.asList("file:delete","file:rename","file:cut","file:copy","file:new:dir","file:upload");
        }else {
            return Arrays.asList("");
        }

    }

    // 返回一个账号所拥有的角色标识集合
    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return Arrays.asList("admin", "super-admin");
    }

}


